package com.github.catvod.spider.merge;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import javax.annotation.Nullable;

public class QF implements Iterable<tF>, Cloneable {
  String[] V0 = new String[3];
  
  private int h = 0;
  
  String[] j = new String[3];
  
  private void BQ(int paramInt) {
    boolean bool;
    if (paramInt >= this.h) {
      bool = true;
    } else {
      bool = false;
    } 
    R2.j(bool);
    String[] arrayOfString = this.V0;
    int j = arrayOfString.length;
    if (j >= paramInt)
      return; 
    int i = 3;
    if (j >= 3)
      i = this.h * 2; 
    if (paramInt <= i)
      paramInt = i; 
    this.V0 = Arrays.<String>copyOf(arrayOfString, paramInt);
    this.j = Arrays.<String>copyOf(this.j, paramInt);
  }
  
  private boolean GM(String paramString) {
    boolean bool = true;
    if (paramString == null || paramString.length() <= 1 || paramString.charAt(0) != '/')
      bool = false; 
    return bool;
  }
  
  private void Og(int paramInt) {
    boolean bool;
    if (paramInt >= this.h) {
      bool = true;
    } else {
      bool = false;
    } 
    R2.V0(bool);
    int i = this.h - paramInt - 1;
    if (i > 0) {
      String[] arrayOfString = this.V0;
      int j = paramInt + 1;
      System.arraycopy(arrayOfString, j, arrayOfString, paramInt, i);
      arrayOfString = this.j;
      System.arraycopy(arrayOfString, j, arrayOfString, paramInt, i);
    } 
    paramInt = this.h - 1;
    this.h = paramInt;
    this.V0[paramInt] = null;
    this.j[paramInt] = null;
  }
  
  private int PD(String paramString) {
    R2.u(paramString);
    for (byte b = 0; b < this.h; b++) {
      if (paramString.equalsIgnoreCase(this.V0[b]))
        return b; 
    } 
    return -1;
  }
  
  static String W(@Nullable String paramString) {
    String str = paramString;
    if (paramString == null)
      str = ""; 
    return str;
  }
  
  static String j5(String paramString) {
    StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append('/');
    stringBuilder.append(paramString);
    return stringBuilder.toString();
  }
  
  public String F8(String paramString) {
    int i = PD(paramString);
    if (i == -1) {
      paramString = "";
    } else {
      paramString = W(this.j[i]);
    } 
    return paramString;
  }
  
  public void I(QF paramQF) {
    if (paramQF.size() == 0)
      return; 
    BQ(this.h + paramQF.h);
    Iterator<tF> iterator = paramQF.iterator();
    while (iterator.hasNext())
      w4(iterator.next()); 
  }
  
  void LW(String paramString1, @Nullable String paramString2) {
    int i = PD(paramString1);
    if (i != -1) {
      this.j[i] = paramString2;
      if (!this.V0[i].equals(paramString1))
        this.V0[i] = paramString1; 
    } else {
      q(paramString1, paramString2);
    } 
  }
  
  public void PU() {
    for (byte b = 0; b < this.h; b++) {
      String[] arrayOfString = this.V0;
      arrayOfString[b] = AR.h(arrayOfString[b]);
    } 
  }
  
  public int Qy(Qg paramQg) {
    Object object1;
    Object object2;
    boolean bool = isEmpty();
    boolean bool1 = false;
    if (bool)
      return 0; 
    bool = paramQg.q();
    boolean bool2 = false;
    while (object1 < this.V0.length) {
      int j = object1 + 1;
      int i = j;
      while (true) {
        String[] arrayOfString = this.V0;
        i = SYNTHETIC_LOCAL_VARIABLE_6 + 1;
        object2 = SYNTHETIC_LOCAL_VARIABLE_7;
      } 
      continue;
      object1 = SYNTHETIC_LOCAL_VARIABLE_4;
    } 
    return object2;
  }
  
  public boolean equals(Object paramObject) {
    if (this == paramObject)
      return true; 
    if (paramObject == null || QF.class != paramObject.getClass())
      return false; 
    paramObject = paramObject;
    return (this.h != ((QF)paramObject).h) ? false : (!Arrays.equals((Object[])this.V0, (Object[])((QF)paramObject).V0) ? false : Arrays.equals((Object[])this.j, (Object[])((QF)paramObject).j));
  }
  
  public int hashCode() {
    return (this.h * 31 + Arrays.hashCode((Object[])this.V0)) * 31 + Arrays.hashCode((Object[])this.j);
  }
  
  final void i4(Appendable paramAppendable, HZ.Tw paramTw) {
    int i = this.h;
    for (byte b = 0; b < i; b++) {
      if (!GM(this.V0[b])) {
        String str1 = this.V0[b];
        String str2 = this.j[b];
        paramAppendable.append(' ').append(str1);
        if (!tF.u(str1, str2, paramTw)) {
          paramAppendable.append("=\"");
          str1 = str2;
          if (str2 == null)
            str1 = ""; 
          XR.I(paramAppendable, str1, paramTw, true, false, false);
          paramAppendable.append('"');
        } 
      } 
    } 
  }
  
  public String iU() {
    StringBuilder stringBuilder = ZG.V0();
    try {
      HZ hZ = new HZ();
      this("");
      i4(stringBuilder, hZ.TD());
      return ZG.t(stringBuilder);
    } catch (IOException iOException) {
      throw new zx(iOException);
    } 
  }
  
  public boolean isEmpty() {
    boolean bool;
    if (this.h == 0) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  public Iterator<tF> iterator() {
    return new Tw(this);
  }
  
  public boolean n(String paramString) {
    boolean bool;
    if (PD(paramString) != -1) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  public List<tF> oC() {
    ArrayList<tF> arrayList = new ArrayList(this.h);
    for (byte b = 0; b < this.h; b++) {
      if (!GM(this.V0[b]))
        arrayList.add(new tF(this.V0[b], this.j[b], this)); 
    } 
    return Collections.unmodifiableList(arrayList);
  }
  
  public String oq(String paramString) {
    int i = y(paramString);
    if (i == -1) {
      paramString = "";
    } else {
      paramString = W(this.j[i]);
    } 
    return paramString;
  }
  
  public QF q(String paramString1, @Nullable String paramString2) {
    BQ(this.h + 1);
    String[] arrayOfString = this.V0;
    int i = this.h;
    arrayOfString[i] = paramString1;
    this.j[i] = paramString2;
    this.h = i + 1;
    return this;
  }
  
  public int size() {
    byte b = 0;
    int i;
    for (i = 0; b < this.h; i = j) {
      int j = i;
      if (!GM(this.V0[b]))
        j = i + 1; 
      b++;
    } 
    return i;
  }
  
  public boolean t(String paramString) {
    boolean bool;
    if (y(paramString) != -1) {
      bool = true;
    } else {
      bool = false;
    } 
    return bool;
  }
  
  public String toString() {
    return iU();
  }
  
  public QF u() {
    try {
      QF qF = (QF)super.clone();
      qF.h = this.h;
      this.V0 = Arrays.<String>copyOf(this.V0, this.h);
      this.j = Arrays.<String>copyOf(this.j, this.h);
      return qF;
    } catch (CloneNotSupportedException cloneNotSupportedException) {
      throw new RuntimeException(cloneNotSupportedException);
    } 
  }
  
  public QF w4(tF paramtF) {
    R2.u(paramtF);
    yx(paramtF.V0(), paramtF.j());
    paramtF.q = this;
    return this;
  }
  
  int y(String paramString) {
    R2.u(paramString);
    for (byte b = 0; b < this.h; b++) {
      if (paramString.equals(this.V0[b]))
        return b; 
    } 
    return -1;
  }
  
  public QF yx(String paramString1, String paramString2) {
    R2.u(paramString1);
    int i = y(paramString1);
    if (i != -1) {
      this.j[i] = paramString2;
    } else {
      q(paramString1, paramString2);
    } 
    return this;
  }
  
  class Tw implements Iterator<tF> {
    final QF V0;
    
    int h = 0;
    
    Tw(QF this$0) {}
    
    public tF h() {
      QF qF = this.V0;
      String[] arrayOfString = qF.V0;
      int i = this.h;
      tF tF = new tF(arrayOfString[i], qF.j[i], qF);
      this.h++;
      return tF;
    }
    
    public boolean hasNext() {
      boolean bool;
      while (true) {
        int i = this.h;
        int j = QF.h(this.V0);
        bool = true;
        if (i < j) {
          QF qF = this.V0;
          if (QF.V0(qF, qF.V0[this.h])) {
            this.h++;
            continue;
          } 
        } 
        break;
      } 
      if (this.h >= QF.h(this.V0))
        bool = false; 
      return bool;
    }
    
    public void remove() {
      QF qF = this.V0;
      int i = this.h - 1;
      this.h = i;
      QF.j(qF, i);
    }
  }
}


/* Location:              /Users/hetaiyi/Desktop/my/tech/java/study/aa/temp/temp.jar!/com/github/catvod/spider/merge/QF.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */